Skip to main content

Deploying Java RESTful Engine to Azure App Service

This article describes how to deploy a Java RESTful Engine to Azure App Service. Because Azure App Services do not use a typical Tomcat directory structure or set the CATALINA_HOME environment variable, the Java RESTful Engine WAR file must be modified before it can be deployed to Azure App Service. The steps below describe how to modify the WAR file and deploy it to Azure App Service.

Creating the Azure App Service

When Creating your Azure App Service, make sure you set the following settings:

  • Publish: Code
  • Runtime Stack: Java 17
  • Java Web Server Stack: Tomcat 10.0

Preparing the Java RESTful Engine WAR to run on Azure App Service

  1. Download the Java RESTful Engine WAR file from the our downloads page.
  2. Extract the Zip file to a folder on your computer and the nested version number file.
  3. Extract ROOT.war (war files are just zip files) to a folder on your computer called ROOT.
  4. From the ROOT folder, open WEB-INF/classes/WindwardReports.properties in a text editor.
  5. Add these lines to what is already there:
    requests.path=/home/site/wwwroot/AppData/requests
    resource.cache=/home/site/wwwroot/AppData/cache
    font.files=/home/site/wwwroot/AppData/fonts/
  6. Replace the text [[LICENSE]] with your license key.
  7. Save the file.
  8. Zip the contents of the ROOT folder (not the folder itself) into a file zip file called app.war.
  9. Place app.war in an empty directory
  10. Create a folder in the same directory called AppData.
  11. In the AppData folder, create three folders called requests, cache, and fonts.
  12. Create empty text files in the requests and in in the cache folder called empty.txt.
  13. Place any fonts you will need to generate your documents in the fonts folder.
  14. Zip the contents of the directory you created (this should be a directory containing app.war and the AppData directory) into a new zip file called deploy.zip.

Deploying the Java RESTful Engine WAR to Azure App Service

  1. Open the Azure Portal and navigate to your App Service and take note of the following information:

    • Resource Group: The resource group your App Service is in.
    • App Service Name: The name of your App Service.
    • Subscription: The subscription your App Service is in.
  2. Open PowerShell and run the following commands you will need the Azure CLI installed:

    az login
    az webapp deploy --subscription <your subscription id> --resource-group <your resource group> --name <app service name> --src-path ./deploy.zip
    • If you encounter an error running az login, try running az login --tenant <your tenant id> instead.
  3. Wait for the deployment to complete.

  4. Once you've deployed it may take some time for your changes to take effect. If you're updating an existing app service, you may need to restart the app service to see your changes.